for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import TruthTable from '../../src/TruthTable.mjs';
import InvalidInputError from '../../src/InvalidInputError';
const ErrorTestCases = [
{
description: 'test propositions with a null value',
propositions: null,
expectedError: 'propositions isnt a number',
},
description: 'test propositions with a string',
propositions: 'not ok',
];
describe.each(ErrorTestCases)(
'Test totalTrueInputs helper exception test',
({ description, propositions, expectedError }) => {
it(description, () => {
function testWrongInput() {
TruthTable.create(propositions);
}
expect(testWrongInput).toThrowError(new Error(expectedError));
expect(testWrongInput).toThrowError(InvalidInputError);
});
);